package base.day19;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Date2 {
    public static void main(String[] args) throws ParseException {
        Date d1=new Date();
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
        String time =sdf.format(d1);
        System.out.println(time);

        String s="2024-1-24";
        Date time2=sdf.parse(s);
        System.out.println(time2);
    }
}
